/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-04-19
 * Time: 16:17
 */
public class TestDemo {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        binaryTree.create();
        binaryTree.preOrder(binaryTree.create());
        System.out.println();
        binaryTree.inOrder(binaryTree.create());
        System.out.println();
        binaryTree.postOrder(binaryTree.create());
        System.out.println();
        System.out.println("---求节点个数---");
        System.out.println(binaryTree.size(binaryTree.create()));
        System.out.println("--子问题思路求节点个数---");
        System.out.println(binaryTree.getSize(binaryTree.create()));
        System.out.println("---求叶子节点个数---");
        System.out.println(binaryTree.leafNode(binaryTree.create()));
        System.out.println("--子问题思路求叶子节点个数---");
        System.out.println(binaryTree.getLeafNodeCount2(binaryTree.create()));
        System.out.println("--子问题思路求k层节点个数--");
        System.out.println(binaryTree.getKLevelNodeCount(binaryTree.create(), 3));
        System.out.println("---获取二叉树高度---");
        System.out.println(binaryTree.getHigh(binaryTree.create()));
        System.out.println("--子问题思路求高度---");
        System.out.println(binaryTree.getHeight2(binaryTree.create()));
        System.out.println("--是否存在value值");
        System.out.println(binaryTree.find(binaryTree.create(),'H').val);
        System.out.println("--判断是否是完全二叉树---");
        System.out.println(binaryTree.isCompleteTree(binaryTree.create()));


    }
}
